package com.lyf.shop.web.controller;

import com.alibaba.fastjson.JSON;
import com.lyf.shop.entity.Page;
import com.lyf.shop.entity.Type;
import com.lyf.shop.services.Impl.TypeServiceImpl;
import com.lyf.shop.services.TypeService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/get_all")
public class TypeController extends BaseController {

    public String getAll(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        TypeService typeService = new TypeServiceImpl();
        List<Type> typeList = typeService.getAll();
        String s= JSON.toJSONString(typeList);
        return s;
    }
}
